package com.kai.pojo;

import lombok.Data;

@Data
public class Result {

    private String code; // 状态码 1成功 0失败
    private String msg;  // 返回信息
    private Object data; // 返回数据

    public static Result success(){
        Result  result = new Result();
        result.setCode("1");
        result.setMsg("成功");
        return result;
    }

    public static Result success(Object data){

        Result result = success();
        result.setData(data);
        return result;
    }

    public static Result error(String msg){
        Result result = new Result();
        result.setCode("0");
        result.setMsg(msg);
        return result;
    }
}
